package eg.com.iti.common.daoimpl;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

/**
 * Hibernate Utility class with a convenient method to get Session Factory object.
 *
 * @author Tarek
 */
public class HibernateUtil {

    private static SessionFactory sessionFactory;
    static{
    	
    	Configuration configuration = new Configuration();
        configuration.configure();
        sessionFactory = configuration.buildSessionFactory();
    }
    
    public static Session getCurrentSession(){
    	return sessionFactory.getCurrentSession();
    }

    
}
